package Thread;

import java.util.concurrent.*;

public class Demo3 {
    public static void main(String[] args) {
        //ThreadPoolExecutor pool = new ThreadPoolExecutor(3,5,0L, TimeUnit.SECONDS,new LinkedBlockingQueue<>(2),new ThreadPoolExecutor.AbortPolicy());
        ExecutorService pool = Executors.newFixedThreadPool(3);
        for (int i = 0; i < 30; i++) {
            pool.submit(new Runnable() {
                @Override
                public void run() {
                    System.out.println(Thread.currentThread().getName() + "==>正在办理业务");
                }
            });
        }
    }
}
